Sorts records in the grid.

<div class="definition">
    sort()
</div>

OR

<div class="definition">
    search(field, [direction, [multiField]])
</div>

<div class="arguments">
    <table>
    <tr>
        <td>field</td>
        <td><b>string</b>, field name to search by</td>
    </tr>
    <tr>
        <td>direction</td>
        <td><b>string</b>, direction of search asc/desc (<i>optional</i>)</td>
    </tr>
    <tr>
        <td>multiField</td>
        <td><b>boolean</b>, indicates if previous sort needs to be cleared (<i>optional</i>)</td>
    </tr>
    </table>
</div>

Returns <i>undefined</i>.

<h4>Description</h4>

This method will sort records in the <a class="property" href="w2grid.records">.records</a> array if you have local
data source or submit to the server side if your data source is remote. If you call this method without parameters, it
will reset the sort.
<div style="height: 10px;"></div>

If you have a grid defined in the following way:
<textarea class="javascript">
let grid = new w2grid({
    name    : 'grid',
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%' },
        { field: 'fname', text: 'First Name', size: '30%' },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'Start Date', size: '120px' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    records: [
        { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' },
        { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' },
        { recid: 3, fname: 'Jin', lname: 'Franson', email: '--', sdate: '4/23/2012' },
        { recid: 4, fname: 'Susan', lname: 'Ottie', email: 'jdoe@gmail.com', sdate: '5/3/2012' },
        { recid: 5, fname: 'Kelly', lname: 'Silver', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
        { recid: 6, fname: 'Francis', lname: 'Gatos', email: 'vitali@gmail.com', sdate: '2/5/2012' }
    ]
});
</textarea>

You can do following searches:
<textarea class="javascript">
grid.sort('fname', 'asc');
</textarea>
